package jwlee.testproxy.dynproxy;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.springframework.aop.ThrowsAdvice;
import java.lang.reflect.Method;

/**
 * 处理异常的advise
 * 
 * @author warison
 * 
 *         Oct 20, 2009
 */
public class ExceptionHandler implements ThrowsAdvice {

	private Logger logger = Logger.getLogger(this.getClass().getName());

	// 重写afterThrowing()方法

	public void afterThrowing(Method method, Object[] args, Object target,
			Throwable subclass) throws Throwable {

		logger.log(Level.INFO, args[0] + " 执行 " + method.getName()
				+ " 时有异常抛出...." + subclass);

	}

}
